package ca.llsutherland.nfl.validator;

import ca.llsutherland.nfl.domain.User;
import junit.framework.TestCase;

public class UserValidator extends TestCase {

	public static void validate(User expected, User actual) {
		assertEquals("user should be same username", expected.getUsername(), actual.getUsername());
		assertEquals("user should be same password", expected.getPassword(), actual.getPassword());
		assertEquals("user should be same blocked", expected.isBlocked(), actual.isBlocked());
		assertEquals("user should be same paid", expected.isPaid(), actual.isPaid());
		assertNotNull("user role should not be null", actual.getRole());
		RoleValidator.validate(expected.getRole(), actual.getRole());
		assertNotNull("user people should not be null", actual.getPeople());
		assertFalse("user people should not be empty", actual.getPeople().isEmpty());
		PersonValidator.validate(expected.getPeople(), actual.getPeople());
	}

}
